<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class InsertConfigRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [

           // 验证表单选项
            'webname' => 'required',
            'keywords' => 'required',
            'logo' => 'required',
            'copy_right' => 'required',
            'status' => 'required',
            'register' => 'required',
            'allow' => 'required'
            
        ];
    }

    // 自定义函数 输出表单错误信息
    public function messages(){
        return [

            // 错误信息处理
            'webname.required' => '网站名称不能为空',
            'keywords.required' => '网站关键字不能为空',
            'logo.required' => '网站Logo不能为空',
            'copy_right.required' => '网站版权不能为空',
            'status.required' => '网站名称不能为空',
            'register.required' => '营业执照注册号不能为空',
            'allow.required' => '营业许可证不能为空',
        ];
    }
}
